package com.rhino.security.constants;

import java.util.Arrays;
import java.util.List;

/**
 * 安全常量类
 */
public class SecurityConstants {

    // MediaType
    public static final String APPLICATION_JSON_UTF8_VALUE = "application/json;charset=UTF-8";

    // 认证header的key
    public static final String JWT_HEADER = "Authorization";

    // JWT超时异常定义的字符串
    public static final String EXPIRED_JWT_EXCEPTION = "expiredJwtException";

    // 主动获取jwttokne的字符串
    public static final String INITIATIVE_JWT_TOKEN = "initiativeJWTToken";

    // 登录url
    public static final String LOGIN_PROCESSING_URL = "/authentication/login";

    // 登出的url
    public static final String LOGOUT_URL = "/authentication/logout";

    // 不需要认证的路径
    public static final List<String> AUTH_ANTMATCHERS = Arrays.asList(new String[]{LOGOUT_URL, LOGIN_PROCESSING_URL, "**/","/token/refreshToken/**", "/favicon.ico", "/swagger-ui.html", "/webjars/**", "/v3/**", "/swagger-resources/**", "/swagger-ui/**", "/doc.html", "/druid/**", "/userinfo/**", "/test/**","/actuator/**"});

    // 32位字符串
    public static final String PARENT_ID = "00000000000000000000000000000000";


    // jwtTokenVO 对象名称
    public static final String JWT_TOKEN_VO = "jwtTokenVO";

    /**
     * 接口返回状态
     */
    public static int OK=20000;
    //未授权
    public static int UNAUTHORITED=40000;
    public static int FAIL=50000;
}
